package com.xinnet.mms.contact.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xinnet.mms.contact.dao.ContactDao;
import com.xinnet.mms.contact.service.ContactService;
import com.xinnet.mms.entity.Contact;

@Service("contactService")
public class ContactServiceImpl implements ContactService{

	@Autowired
	ContactDao contactDao;
	
	@Override
	public boolean addContact(Contact contact) {
		
		try {
			contactDao.addContact(contact);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}

	@Override
	public Contact queryContact(Contact contact) {
		// TODO Auto-generated method stub
		return contactDao.queryContact(contact);
	}

	@Override
	public boolean updateContact(Contact contact) {
		try {
			contactDao.updateContact(contact);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}
}
